package com.mer.controller.webController;

import com.mer.service.TeacherCollectService;
import com.mer.vo.AttentionVo;
import com.mer.vo.CommonResult;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: IIPhase-project
 * @description: 教师收藏控制层
 * @author: 张庆恒
 * @create: 2021-10-21 16:39
 **/
@RestController
@RequestMapping("/core/TeacherCollect")
@Api(tags = "前端-教师关注")
public class TeacherCollectController {
    @Resource
    private TeacherCollectService teacherCollectService;
    //将讲师添加到关注中
    @PostMapping("/addAttentionTeacher")
    private CommonResult addAttentionTeacher(@RequestBody AttentionVo attentionVo){
        return teacherCollectService.addAttentionTeacher(attentionVo);
    }
    //加载页面时查询讲师是否被关注
    @PostMapping("/findAttentionTeacher")
    private CommonResult findAttentionTeacher(@RequestBody AttentionVo attentionVo){
        return teacherCollectService.findAttentionTeacher(attentionVo);
    }
    //取消关注
    @PostMapping("/deleteAttentionTeacher")
    private CommonResult cancelAttentionTeacher(@RequestBody AttentionVo attentionVo){
        return teacherCollectService.cancelAttentionTeacher(attentionVo);
    }

    //查看所关注的讲师
    @PostMapping("/findAttentionTeacherById/{memberid}")
    private CommonResult findAttentionTeacherById(@PathVariable("memberid") String memberid){
        return teacherCollectService.findAttentionTeacherById(memberid);
    }

}
